<template>
  <div class="app-container">
    <template>
      <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
        <el-tab-pane v-if="authorityHandle(260)" label="在线时长管理" name="antiAddiction" />
        <el-tab-pane v-if="authorityHandle(261)" label="消费管理" name="recharge" />
      </el-tabs>
      <div class="tab-content">
        <keep-alive>
          <component :is="curTabcompnents[activeName]" />
        </keep-alive>
      </div>
    </template>
  </div>
</template>

<script>
import antiAddiction from './components/antiAddiction.vue'
import recharge from './components/recharge'

export default {
  components: {
    antiAddiction,
    recharge
  },
  data() {
    return {
      activeName: 'antiAddiction',
      curTabcompnents: {
        'antiAddiction': 'antiAddiction',
        'recharge': 'recharge'
      }
    }
  },
  mounted() {
    if (!this.authorityHandle(260)) {
      this.activeName = 'recharge'
    }
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event)
    }
  }
}
</script>

<style lang="scss" scoped>
$borderColor: #e8e8e8; // 主色调
$backColor: #f5f5f5; // 主色调
$mainColor: #3b425d; // 主色调
</style>
